#include <stdio.h>

/* 1990年1月1日 是星期一 */
///判断闰年
int isleap(int year)
{
    return ((year % 4 == 0) && (year % 100 != 0)) || (year % 400 == 0);
}

/// 计算1/1到输入月份1日之间的天数
int sum_monthday(int month, int leap)
{
    int sum = 0;
	int monthday[] = {0, 31, 28, 31, 30, 31, 30, 31, 31, 30, 31, 30, 31};
    
	for(int i = 0; i < month; i++)
	{
		sum += monthday[i];
		if(2 == i)
		{
			sum += leap;
		}
	}
	
    return sum;
}

/// 根据日期计算星期几
int get_weekday(int year, int month, int day)
{
	int leap, week;
	int sum = 0;
	for (int i = 1990; i < year; i++)
    {
        if (isleap(i))
        {
            sum += 366;
        }
        else
        {
            sum += 365;
        }
    }

    leap = isleap(year);

    sum += sum_monthday(month,leap);

    sum += day;
    week = sum % 7;
	return week;
}

int main()
{
    int year, month, day, week, leap;

    scanf("%d/%d/%d", &year, &month, &day);

    if(day < 1 || day > 31)
    {
        printf("输入日期错误\n");
    }

    week = get_weekday(year, month, day);

	char* weekday[] = {"日", "一", "二", "三", "四", "五", "六"};
	printf("%d年%d月%d日是星期%d\n", year, month, day, weekday[week]);
}